<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title></title>
		<style>
			body{
						background-color: #F0F0F0;
		}
				body{
					background-color: #F0F0F0;
				}
				img{
					width: 300px;
					height: 100px;
					margin-bottom:10px ;
				}
				
				a span{
					color: red;
				}
					
				input{
					width: 300px;
					height: 50px;
					margin-bottom: 15px;
					margin-right:10px ;
				}
					
				.dl{
					width: 500px;
					height: 500px;
					background: #fff;
					margin: 50px auto;
					text-align: center;
				}
				input:nth-of-type(5){
					background: red;
					color: #fff;
				}
				#txt{
					width: 200px;
					height: 50px;
					box-sizing: border-box;
					}
				#btn{
					width: 100px;
					height: 50px;
					box-sizing: border-box;
					border-left: none;
				}
				
	</style>
	</head>
	<body>
		<div class="dl">
			<h2>注册账号</h2>
			<from id="_form">
				<input type="" name="username" id="userName" placeholder="邮箱/手机号/用户名"><span id="yanzhengnamer"></span><br>
				<input type="password" name="userpwd" id="oMiMa" placeholder="密码为6~16个字符(数字,字母,符号,至少包含俩种)"><span id="yanzhengmima1"></span><br>
				<input type="button" value="提交" id="sub" /><br>
				<button type="reset">重置</button>
			</from>
			<a href="#">已有账号<span>|直接登录</span></a>
		</div>
	</body>
</html>
<script src="jquery.min.js"></script>
<script>
	let sub = $("#sub")
	let userName = $("#userName")
	let oMiMa = $("#oMiMa")

	sub.click(function() {
		$.ajax({
			url: "http://10.35.165.102:81/tianjia",
			data: {
				name: userName.val(),
				password: oMiMa.val(),
			},
			success(data) {
				if (data === "success") {
					alert("注册成功")
				} else {
					if (data === "requst") {
						alert("该账号已被注册")
					} else {
						alert("注册失败")
					}
				}


			}

		})
	})
</script>
